package com.platform.service;

import com.platform.dao.ApiCircleBillMapper;
import com.platform.entity.ApiCircleBillVo;
import com.platform.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Service接口
 *
 * @author zhurusen
 * @email 524227263@qq.com
 * @date 2018-05-14 23:16:55
 */
@Service
public class ApiCircleBillService {
    @Autowired
    private ApiCircleBillMapper apiCircleBillMapper;

    public void save(ApiCircleBillVo billVo) {
        apiCircleBillMapper.save(billVo);
    }

    public List<ApiCircleBillVo> selectList(Map params) {
        return apiCircleBillMapper.queryList(params);
    }

    public Integer selectCount(Map<String, Object> param_ds) {
        return apiCircleBillMapper.queryTotal(param_ds);
    }

    public ApiCircleBillVo selectByTypeAndId(Map<String, Object> params) {
        List<ApiCircleBillVo> apiCircleBillVos = apiCircleBillMapper.queryList(params);
        return apiCircleBillVos.size() > 0 ? apiCircleBillVos.get(0) : null;
    }

    public void del(Long id) {
        apiCircleBillMapper.delete(id);
    }

}
